package flatlandRPG;

import org.lwjgl.util.vector.Vector2f;

// -------------------------------------------------------------------------
/**
 *  A trigger class that teleports the player from one location to another.
 *
 *  @author evant
 *  @version May 1, 2011
 */
public class TeleportTrigger
    extends Trigger
{

    // ----------------------------------------------------------
    /**
     * Create a new TeleportTrigger object.
     * @param player the player
     * @param location the location of the trigger
     * @param destination the location to teleport the player to
     * @param radius the radius that the trigger takes effect in
     */
    public TeleportTrigger(
        final Player player,
        Vector2f location,
        final Vector2f destination,
        float radius)
    {
        super(player, location, radius, new Action() {
            @Override
            public void activate()
            {
                player.setLocation(destination);
            }
        });
    }
}
